package com.linkage.educloud.ah.http;

import com.zhouyou.http.exception.ApiException;
import com.zhouyou.http.subsciber.BaseSubscriber;
import com.zzhou.common.library.util.LogUtils;

import io.reactivex.annotations.NonNull;

/**
 * <desc>
 * Created by The Moss on 2018/8/14.
 */

public abstract class CustomSubscriber<T> extends BaseSubscriber {

    @Override
    public void onNext(Object o) {
//        super.onNext(o);
        LogUtils.d("subscriber onNext");
        onSuccess((T)o);
    }

    @Override
    public void onError(ApiException e) {
        onFail(e);
    }
    public abstract void onFail(ApiException e);
    public abstract void onSuccess(@NonNull T t);
}
